<template>
  <div class="box">
    <div class="allbox loginallbox">
      <div class="tag_box">
        <div class="tab">{{ this.$route.meta.title }}</div>
      </div>
      <div class="login_box_gr">
        <div class="login_box_gr_input">
          <div class="login_title">{{ this.$route.meta.title }}</div>
          <el-input placeholder="请输入登录账号" v-model="form.mobile">
            <template slot="prepend">账号：</template>
          </el-input>
          <el-input
            show-password
            placeholder="请输入密码"
            v-model="form.password"
          >
            <template slot="prepend">密码：</template>
          </el-input>
          <div class="delu" @click="dl()">登录</div>
          <div class="tishi_login">
            <!-- <div>
                没有账号，去
                <router-link to="jgzc"
                  ><span class="tz">注册机构会员</span></router-link
                >
              </div> -->
            <div>
              <router-link to="zjwjmm"
                ><span class="tz">忘记密码？</span></router-link
              >
            </div>
          </div>
          <div class="bottom_login">登录账号为：手机号</div>
        </div>
      </div>
    </div>
  </div>
</template>
    
    <script>
export default {
  data() {
    return {
      form: {
        mobile: "",
        password: "",
      },
    };
  },

  mounted() {},
  methods: {
    /**
     * 登录
     */
    dl() {
      // localStorage.setItem("zjtoken", "121212");

      // this.$router.push({ path: "/indexzj" });
      let that = this;
      let data = that.form;
      // console.log(JSON.stringify(data))
      that.$http.post("expert/login", data).then((res) => {
        // console.log(res);
        that.$self.ts(res, 3).then((e) => {
          // console.log(e)
          localStorage.clear();

          // if (localStorage.getItem("jgtoken")) {
          //   localStorage.removeItem("jgtoken");
          // } else if (localStorage.getItem("grtoken")) {
          //   localStorage.removeItem("grtoken");
          // }

          localStorage.setItem("zjtoken", res.data.token);

          this.$router.push({ path: "/indexzj" });
        });
      });
    },
    //  ==
  },
};
</script>
<style scoped>
::v-deep .el-input-group__prepend{
width: 0.9rem;
color: #333;

}
</style>